import { Injectable } from '@angular/core';
import { ModalController } from 'ionic-angular';
import { GalleryModal } from 'ionic-gallery-modal';
/*
  Generated class for the ImagesProvider provider.

  See https://angular.io/guide/dependency-injection for more info on providers
  and Angular DI.
*/
@Injectable()
export class ImagesProvider {

	constructor(
		public modalCtrl: ModalController) {
		console.log('Hello GalleryProvider Provider');
	}

	/**
	 * 显示图片
	 * photos: Array[{ url: string, type: string,}],
	 * closeIcon: string,
	 * initialSlide: number,
	 */
	public showGallery(photos: any, index: any) {
		let modal = this.modalCtrl.create(GalleryModal, {
			photos: photos,
			initialSlide: index
		});
		modal.present();
	}
}